package com.haoze.nurseapp.dao;

import com.haoze.nurseapp.model.DrugCollectionEntity;
import com.haoze.nurseapp.model.PrintMarkEntity;
import com.haoze.nurseapp.model.StaticmedicineRecordEntity;
import com.haoze.nurseapp.vo.BatchMedicalVO;
import com.haoze.nurseapp.vo.StaticDistributionVO;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @Author: Chenchao
 * @CreateTime: 2020-04-14 10:43
 */
public interface InpDispensaryMapper {


    List<Map<String, Object>> queryList(@Param("wardId") String wardId, @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    List<Map<String, Object>> queryAppList(@Param("wardId") String wardId, @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    List<BatchMedicalVO> docDetailList(@Param("docNo") String docNo);

    List<BatchMedicalVO> bedList(@Param("docNo")String docNo, @Param("phamStdCode") String phamStdCode);

    List<BatchMedicalVO> bedDetailList(@Param("docNo")String docNo);

    List<BatchMedicalVO> docAcceptedDetailList(@Param("docNo")String docNo);

    List<BatchMedicalVO> docUnAcceptedDetailList(@Param("docNo")String docNo);

    List<BatchMedicalVO> docDefectDetailList(@Param("docNo")String docNo);

    Integer insertDrugCollectionEntity(@Param("list") List<DrugCollectionEntity> drugCollectionEntity);

    List<BatchMedicalVO> queryReason();

    List<StaticDistributionVO> docStaticDetailList(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("wardId") String wardId, @Param("notInbarCodes") String[] notInbarCodes, @Param("barCode") String barCode, @Param("type") String type, @Param("searchValue")String searchValue);

    List<StaticDistributionVO> queryReturnReason();

    Map<String, BigDecimal> docStaticDetailNum(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("wardId")String wardId);

    Integer insertStaticmedicineRecordEntity(@Param("list") List<StaticmedicineRecordEntity> list);

    List<BatchMedicalVO> pcDocDetailList(@Param("docNo") String docNo, @Param("drugName") String drugName, @Param("reqId") String reqId);

    List<BatchMedicalVO> pcReceivedList(@Param("docNo") String docNo, @Param("drugCode") String drugCode, @Param("reqId") String reqId);

    List<BatchMedicalVO> pcDefectedList(@Param("docNo") String docNo, @Param("drugCode") String drugCode, @Param("reqId") String reqId);

    List<BatchMedicalVO> pcPatientPersonList(@Param("docNo") String docNo, @Param("drugCode") String drugCode,
                                             @Param("isPrint") String isPrint, @Param("reqId") String reqId,@Param("prescNo") String prescNo);

    List<BatchMedicalVO> pcPatientDrugList(@Param("docNo") String docNo, @Param("patientInfo") String patientInfo, @Param("drugName") String drugName, @Param("reqId") String reqId);

    Integer pcPrintSendDrug(@Param("orderNo")String docNo, @Param("drugCode")String drugCode);

    Integer pcWritePrintSendDrug(@Param("printMarkEntity") PrintMarkEntity printMarkEntity);

    Integer pcUpdatePrintSendDrug(@Param("orderNo")String docNo, @Param("drugCode")String drugCode);

    List<BatchMedicalVO> pcNotSendInfo(@Param("docNo")String docNo,@Param("patientInfo") String patientInfo,@Param("orders") String orders);

    List<StaticDistributionVO> docAllStaticDetailList(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("wardId") String wardId, @Param("notInbarCodes") String[] notInbarCodes, @Param("barCode") String barCode, @Param("type") String type, @Param("searchValue")String searchValue);

    Integer checkOrderIsStop(@Param("barCode") String barCode);

    Integer checkOrderIsStopByLack(@Param("docNo") String docNo, @Param("phamStdCode") String phamStdCode);

    Integer checkUnAccepted(@Param("phamStdCode") String phamStdCode, @Param("docNo") String docNo, @Param("acceptedCount") Integer acceptedCount, @Param("defectCount") Integer defectCount);

    Integer checkStaticUnAccept(@Param("barCode") String barCode);

    Integer getTotalNum(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("wardId") String wardId, @Param("notInbarCodes") String[] notInbarCodes, @Param("barCode") String barCode, @Param("type") String type, @Param("searchValue")String searchValue);

//    long bedDetailListTotal(@Param("docNo") String docNo);
//
//    long docStaticDetailListCount(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("wardId") String wardId, @Param("notInbarCodes") String[] notInbarCodes, @Param("barCode") String barCode, @Param("type") String type, @Param("searchValue")String searchValue);
}



